package cn.akwangl.dubbo.controller;

import cn.akwangl.dubbo.api.IUserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户服务消费者
 *
 * @author youyongkun
 * @date 2021/8/4 15:17
 */
@RestController("/userController")
public class UserController {

    @DubboReference(interfaceClass = IUserService.class, url = "dubbo://127.0.0.1:20881")
    IUserService iUserService;

    @GetMapping("/name")
    public String name() {
        return iUserService.userName();
    }

}
